package demo3;

public class Text01 {
    public static void main(String[] args) throws InterruptedException {
        // 创建阻塞队列
        MyBlockingQueue queue = new MyBlockingQueue(3);
        // 入队元素
        queue.put(1);
        queue.put(2);
        queue.put(3);
        System.out.println("已经入队了三个元素...");
//        queue.put(4);
//        System.out.println("已经入队了四个元素...");
        System.out.println(queue.take());
        System.out.println(queue.take());
        System.out.println(queue.take());
        System.out.println("已经取出了三个元素...");
        System.out.println(queue.take());
        System.out.println("已经取出四了个元素...");
    }
}
